CFLAGS = 
MFLAGS = 

# target queens:
#   Compile queens.cc into an executable
queens: queens.cc
	g++ $(CFLAGS) -o queens queens.cc

# target bases:
#   Compile queens.meta into all base languages.
bases: python perl java cpp

# target python:
#   Run the python version of queens (via Meta)
python py: .meta/oopl/python/queens.py
	metapy queens.Queen

# target perl:
#   Run the perl version of queens (via Meta)
perl: .meta/oopl/perl/queens.pm
	metaperl queens.Queen

# target cpp:
#   Run the cpp version of queens (via Meta)
cpp: .meta/oopl/cpp/queens.cc
	metacpp queens.Queen

# target javascript:
#   Run the javascript version of queens (via Meta)
javascript js: .meta/oopl/javascript/queens.py
	metajs queens.Queen

# target java:
#   Run the java version of queens (via Meta)
java: .meta/oopl/java/queens.java
	metajava queens.Queen

# target .meta/oopl/python/queens.py:
#   Ensure that the generated Meta python code is up to date relative to the
#   .meta source file.
.meta/oopl/python/queens.py: .FORCE
	metac $(MFLAGS) -b python -c queens.meta

# target .meta/oopl/perl/queens.pm:
#   Ensure that the generated Meta perl code is up to date relative to the
#   .meta source file.
.meta/oopl/perl/queens.pm: .FORCE
	metac $(MFLAGS) -b perl -c queens.meta

# target .meta/oopl/cpp/queens.cc:
#   Ensure that the generated Meta cpp code is up to date relative to the
#   .meta source file.
.meta/oopl/cpp/queens.cc: .FORCE
	metac $(MFLAGS) -b cpp -c queens.meta

# target .meta/oopl/javascript/queens.pm:
#   Ensure that the generated Meta javascript code is up to date relative to the
#   .meta source file.
.meta/oopl/javascript/queens.js: .FORCE
	metac $(MFLAGS) -b javascript -c queens.meta

# target .meta/oopl/java/queens.java:
#   Ensure that the generated Meta java code is up to date relative to the
#   .meta source file.
.meta/oopl/java/queens.java: .FORCE
	metac $(MFLAGS) -b java -c queens.meta

# target clobber:
#   Remove .meta file
clobber: .FORCE
	rm -rf .meta

.FORCE:
